From 27b186a0dbe932c15195a24a520b92a2d2282d92 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 16 Oct 2008 18:36:43 +0100 Subject: [PATCH] Fix SCHEDOP_poll to avoid wakeup-waiting race on interrupt delivery. Race found by Jan Beulich. Signed-off-by: Keir Fraser --- xen/common/schedule.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 12882d0204..04b09e2168 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -455,6 +455,10 @@ static long do_poll(struct sched_poll *sched_poll) goto out; #endif + rc = 0; + if ( local_events_need_delivery() ) + goto out; + for ( i = 0; i < sched_poll->nr_ports; i++ ) { rc = -EFAULT; -- 2.30.2